#include "physics/Physics.h"
#include "util/Shared_ptr.h"


using namespace Boon;
using namespace Physics;


Boon::Weak_ptr<IPhysics> gPhysics;

void __SetGlobalPhysicsInstance( const Boon::Weak_ptr<IPhysics>& instance )
{
}

Boon::Physics::IPhysics* Boon::Physics::GetPhysics()
{
	if( !gPhysics.Empty() )
		return gPhysics.Lock().Get();
	return nullptr;
}

void Boon::Physics::__SetGlobalPhysicsInstance( const Boon::Weak_ptr<IPhysics>& instance )
{
	gPhysics = instance;
}

bool Boon::Physics::RayCast( const Vector3& origin, const Vector3 direction, RaycastHit& outHit, float distance, bool staticOnly )
{
	return gPhysics.Lock()->RayCast( origin, direction, outHit, distance, staticOnly );
}
